#include <stdio.h>
#include <time.h>
#include<dirent.h>
#include<string.h>

int main(int argc, char *argv){
	//char sysCommand[100];
	time_t start, end;
	double dif;
	time(&start);
  
	FILE *fp, *fp2;
  	fp = fopen("hashlistLenny", "r");
	
	int i,j=0;
	if(fp!=NULL){
		char line[41], line2[41], tmp[41];
	
		while(fgets(line, 41, fp) != NULL){
			//printf("Lenny: %s\n",line);
			fp2 = fopen("hashlistDapper", "r");
			for(i=0;i<41;i++){
				tmp[i]=line[i];
			}
			
			while(fgets(line2, 41, fp2) != NULL){
				if(strncmp(tmp, line2, 41)==0){
					printf(" match Dapper : %s, Lenny :%s \n", fgets(line2, 41, fp2), tmp);
					j++;
					break;
				}
				
				
				//fgets(line2, 41, fp2);
			}
			//if(i>0)					
				
			fclose(fp2);
			//printf("%i", i);
			//printf("test1");
			fgets(line, 41, fp);
			//printf("test2");
		}
		printf("%i", j);
	}else{
		printf("wtf");
	}	

	fclose(fp);
	

	time(&end);
	dif= difftime(end,start);
	printf("time to hash %.2lf seconds \n",dif);
	return 0;

}
